package com.cxh.rmsq.net.service;

import androidx.lifecycle.LiveData;

import com.cxh.rmsq.db.model.AuthenticationBean;
import com.cxh.rmsq.db.model.BaseResultCommentListBean;
import com.cxh.rmsq.db.model.BaseResultListBean;
import com.cxh.rmsq.db.model.CommunityContent;
import com.cxh.rmsq.model.Result;
import com.cxh.rmsq.model.Result2;
import com.cxh.rmsq.model.SecurityStatusResult;
import com.cxh.rmsq.model.SecurityVerifyResult;
import com.cxh.rmsq.net.SealTalkUrl;

import java.util.Map;

import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;

public interface SocialCircleService {

    /**
     * 查询数美开关状态
     *
     * @return
     */
    @GET(SealTalkUrl.SECURITY_STATUS)
    LiveData<Result<SecurityStatusResult>> querySecurityStatus();

    /**
     * 数美黑产验证
     *
     * @return
     */
    @GET(SealTalkUrl.SECURITY_VERIFY)
    LiveData<Result<SecurityVerifyResult>> doSecurityVerify(
            @QueryMap(encoded = true) Map<String, String> queryMap);

    /**
     * 实名认证相关
     *
     * @return
     */
    @GET(SealTalkUrl.Authentication_Status)
    LiveData<Result2<AuthenticationBean>> getAuthentication(@Query("userId") String userId);

    /**
     * 根据toUserID获得用户社区分页
     *
     * @return
     */
    @GET(SealTalkUrl.UserCommunityContentPage)
    LiveData<Result2<BaseResultListBean>> getToUserCommunityContentPage(@Query("userId") String userId, @Query("toUserId") String toUserId, @Query("pageNo") int pageNo, @Query("pageSize") int pageSize);

    /**
     * 用户社区分页
     *
     * @return
     */
    @GET(SealTalkUrl.CommunityPage)
    LiveData<Result2<BaseResultListBean>> getCommunityPage(@Query("userId") String userId, @Query("toUserId") String toUserId, @Query("pageNo") int pageNo, @Query("pageSize") int pageSize);

    /**
     * 用户社区分页
     *
     * @return
     */
    @GET(SealTalkUrl.SubscriberCommunityPage)
    LiveData<Result2<BaseResultListBean>> getSubscriberCommunityPage(@Query("userId") String userId, @Query("toUserId") String toUserId, @Query("pageNo") int pageNo, @Query("pageSize") int pageSize);

    /**
     * 根据toUserID获得用户社区分页
     *
     * @return
     */
    @GET(SealTalkUrl.CircleCommunityPage)
    LiveData<Result2<BaseResultListBean>> getCircleCommunityPage(@Query("userId") String userId, @Query("circleId") String circleId, @Query("pageNo") int pageNo, @Query("pageSize") int pageSize);

    /**
     * 创建点赞记录 社区动态-评论
     *
     * @return
     */
    @POST(SealTalkUrl.CommentLiked)
    LiveData<Result2<String>> commentLiked(@Body RequestBody body);

    /**
     * 获取社区动态信息
     *
     * @return
     */
    @GET(SealTalkUrl.CommunityInfo)
    LiveData<Result2<CommunityContent>> getCommunityInfo(@Query("id") String id, @Query("viewerId") String viewerId);

    /**
     * 获取社区动态信息
     *
     * @return
     */
    @GET(SealTalkUrl.CommentList)
    LiveData<Result2<BaseResultCommentListBean>> getCommentList(@Query("contentId") String contentId, @Query("pageNo") int pageNo, @Query("pageSize") int pageSize);


    /**
     * 创建社区评论
     *
     * @return
     */
    @POST(SealTalkUrl.CreateComment)
    LiveData<Result2<CommunityContent>> CreateComment(@Body RequestBody body);


    /**
     * 删除社区评论
     *
     * @return
     */
    @DELETE(SealTalkUrl.DelComment)
    LiveData<Result2<String>> DelComment(@Query("id") String id);

    /**
     * 创建社区动态
     *
     * @return
     */
    @POST(SealTalkUrl.CreateCommunity)
    LiveData<Result2<String>> CreateCommunity(@Body RequestBody body);


}
